package com.doctcloud.datacloud.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.doctcloud.common.core.annotation.Excel;
import lombok.*;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

import static com.doctcloud.common.core.utils.StringUtils.trim;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@EqualsAndHashCode(of = {"deptCode"})
@TableName("dept_dict")
public class DeptDictEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Excel(name = "科室代码")
    @NotBlank(message = "科室代码不得为空")
    private String deptCode;
    @Excel(name = "科室名称")
    @NotBlank(message = "科室名称不得为空")
    private String deptName;

    public void setDeptName(String deptName) {
        this.deptName = trim(deptName);
    }

    public void setDeptCode(String deptCode) {
        this.deptCode = trim(deptCode);
    }
}
